package com.wyl.servlet

import javax.servlet.annotation.WebServlet
import javax.servlet.http.HttpServlet
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse


@WebServlet(value = ["/servlet/hello", "/servlet/hello2"])
class HelloServlet : HttpServlet() {
    override fun doPost(req: HttpServletRequest, resp: HttpServletResponse) {
        println("HelloServlet...")
        resp.writer.write("hello\n")
        resp.writer.write("你好, 世界")
    }

    override fun doGet(req: HttpServletRequest, resp: HttpServletResponse) {
        doPost(req, resp)
    }
}